package com.stlm2.dems.user.entity;

/**
 * Created by apple on 2017/5/27.
 */
public enum Sex {
    Privacy(1) {
        public String toString() {
            return "隐私";
        }
    },
    Male(4) {
        public String toString() {
            return "男";
        }
    },
    Female(7) {
        public String toString() {
            return "女";
        }
    };

    private final int val;

    Sex(int n) {
        val = n;
    }

    public int getIntValue() {
        return val;
    }

    public static Sex getByIntValue(int n) {
        switch (n) {
            case 1:
                return Privacy;
            case 4:
                return Male;
            case 7:
                return Female;
            default:
                return null;
        }
    }
}
